/*
 * timer.h
 *
 * Created: 06.05.2012 22:25:59
 *  Author: Maxim Karban <maxim.karban@gmail.com>
 */ 


#ifndef TIMER_H_
#define TIMER_H_

enum SensorState{
  SS_INIT_1,
  SS_INIT_2,
  SS_NORMAL_1,
  SS_NORMAL_2
};

typedef struct tHalcyonLocks{
#if defined(BARO)
  bool pressure_data_ready:1;
  bool altitude_ready:1;
#endif
#if defined(ACCEL)
  bool accel_data_ready:1;
  bool accel_ready:1;
#endif
#if defined(BARO) | defined(ACCEL)
  bool any_data_printed:1;
#endif

#if defined(GPS)
  bool gps_gga_is_ready:1;
  bool gps_rmc_is_ready:1;
  bool gpsDataLocked:1;
  //bool gpsDataCacheLocked;
#endif
  bool mark200ms:1;
  bool mark500ms:1;
  bool mark1s:1;
  bool mark5s:1;
} __attribute__((__packed__)) sHalcyonLocks;

extern sHalcyonLocks hLock;

extern void timer1Init(void);
extern void sysEventsInit(void);


#endif /* TIMER_H_ */